home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
varia
/
interp18.lha
/
interp-1.8
/
Context.h
< prev
next >
Wrap
C/C++ Source or Header
|
1990-01-20
|
2KB
|
52 lines
// -*- C++ -*- Context.h --- the class declaration for a context.
// Copyright (C) 1989 Carey Richard Murphey.
// (rich@rice.edu) 5310 Rutherglenn, Houston, TX 77096
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 1, or (at your option)
// any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef _Context_h_
#pragma once
#define _Context_h_ 1
#include "Table.XPlex.h"
class Context // an ordered set of symbol tables.
{
protected:
TableXPlex tab;
public:
// start with the global symbol table.
Context (Table global) {tab.add_high (global);}
~Context () {}
Symbol& operator [] (String& name);
Table table (String& name);
int contains (String& name);
int top_level (String& name);
void open (); // open a new context
void close (); // close a context
Table top_table () {return tab.high_element ();} // the outermost table.
};
#if defined(__OPTIMIZE__) && !defined(INLINE)
#define INLINE inline
#include "Context.cc"
#ifdef INLINE
#undef INLINE
#endif
#endif
extern Context context;
#endif